Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/model/src/commonMain/kotlin/org/meshtastic/core/model/SessionStatus.kt 4e15ef1c7f68f8c683fe8b7ff741a5167e154d2e (4e15ef1c) Text, 1.96 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model

Tff7b72import T7ee787kotlin.time.Instant

T8b949e/**
* Durable per-node remote-administration session status, derived from the time of the last admin response that carried
* a `session_passkey` from the target node.
*
* The Meshtastic firmware enforces a 300 s session TTL and rotates the passkey at the 150 s mark when sending any admin
* response (see `firmware/src/modules/AdminModule.cpp:1460-1481`). To leave headroom for in-flight packets and clock
* skew, the Android client treats sessions older than 240 s as [Stale] — still potentially usable for a single ping but
* the UI should refresh before navigating the user into a screen that fires more admin requests.
*/
Tff7b72sealed Tff7b72interface T56d364SessionStatus Tb4b4b4{
T8b949e/** No admin response with a session passkey has ever been observed for this node since connect. */
Tff7b72data Tff7b72object T56d364NoSession Tb4b4b4: Te6edf3SessionStatus

T8b949e/** A fresh session passkey is on file and is well within the firmware TTL. */
Tff7b72data Tff7b72class T56d364ActiveTb4b4b4(Tff7b72val Te6edf3refreshedAtTb4b4b4: Te6edf3InstantTb4b4b4) Tb4b4b4: Te6edf3SessionStatus

T8b949e/**
* A session passkey is on file but the firmware may have already rotated it or be about to expire it; refresh
* before sending further admin traffic.
*/
Tff7b72data Tff7b72class T56d364StaleTb4b4b4(Tff7b72val Te6edf3refreshedAtTb4b4b4: Te6edf3InstantTb4b4b4) Tb4b4b4: Te6edf3SessionStatus
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s